﻿Public Class frmConsultaMotivo
    Private mot As New _motivo

    Private _idMotivo As Integer
    Public Property idMotivo() As Integer
        Get
            Return _idMotivo
        End Get
        Set(ByVal value As Integer)
            _idMotivo = value
        End Set
    End Property
    Private _dsMotivo As String
    Public Property dsMotivo() As String
        Get
            Return _dsMotivo
        End Get
        Set(ByVal value As String)
            _dsMotivo = value
        End Set
    End Property

    Private Sub preencheGridMotivo()

        dgvMotivo.AutoGenerateColumns = False
        dgvMotivo.DataSource = mot.consultaMotivo.Tables("dataSet")

    End Sub

    Private Sub frmConsultaMotivo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        preencheGridMotivo()

    End Sub

    Private Sub btnInserir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInserir.Click
        Dim j As New frmCadastroMotivo
        j.ShowDialog()
    End Sub

    Private Sub dgvMotivo_CellDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvMotivo.CellDoubleClick

        Me.idMotivo = dgvMotivo.CurrentRow.Cells("O_ID_MOTIVO").Value()
        Me.dsMotivo = dgvMotivo.CurrentRow.Cells("O_DS_MOTIVO").Value

        Me.DialogResult = Windows.Forms.DialogResult.OK
        Me.Close()


    End Sub

End Class